import request from "@/utils/request";

//获取文章分类
export const getChannelsService = () => {
  return request.get("/my/cate/list");
};

//添加文章分类
export const addChannelService = (data) => {
  return request.post("/my/cate/add", data);
};

//删除文章分类
export const delChannelService = (id) => {
  return request.delete("/my/cate/del", { params: { id: id } });
};

//更新文章分类
export const editChannelService = (data) => {
  return request.put("/my/cate/info", data);
};

//获取文章列表
export const getArticlesService = (params) => {
  return request.get("/my/article/list", {
    params: params,
  });
};

//删除文章
export const delArticleService = (id) => {
  return request.delete("/my/article/info", {
    params: {
      id: id,
    },
  });
};

//添加文章
export const addArticleService = (data) => {
  return request.post("/my/article/add", data);
};

//获取文章详情
export const getArticleInfoService = (id) => {
  return request.get("/my/article/info", {
    params: { id },
  });
};

//更新文章
export const updateArticleInfoService = (data) => {
  return request.put("/my/article/info",data)
}
